Skip to content

Instantly share code, notes, and snippets.

@jjsquady
jjsquady / nextjs-deploy.md
Last active May 12, 2024 06:44
Deploying NEXTJS site with nginx + pm2

How to setup next.js app on nginx with letsencrypt

next.js, nginx, reverse-proxy, ssl

1. Install nginx and letsencrypt

$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt

Also enable nginx in ufw

:: Save this as SteamTrackingFix.bat and place it in your Godot folder.
:: The name doesn't really matter, but you may need to enable viewing file extensions in Windows to save it as a batch file.
:: Run this again if Godot updates and steam tracking stops working.
@echo off
echo -----
echo Don't forget to add '/K godot.exe' to your Steam Godot Launch Options!
echo -----
:: BatchGotAdmin
:-------------------------------------
@marslo
marslo / Makefile.patch
Last active May 12, 2024 06:40
patch for build lua v5.4.6 as a shared library (liblua.so)
--- Makefile 2024-01-04 18:12:26.836000000 -0800
+++ Makefile.patched 2024-01-04 18:14:09.840000000 -0800
@@ -38,21 +38,21 @@
# Convenience platforms targets.
PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris
+# Lua version and release.
+V= 5.4
+R= $V.6
+
@codorizzi
codorizzi / HorizontalOrVerticalLayoutGroupEditor.cs
Last active May 12, 2024 06:40
Unity - Smooth Layout Group (using DoTween)
using UnityEditor;
using UnityEngine;
namespace Utility.SLayout {
[CustomEditor(typeof(SHorizontalOrVerticalLayoutGroup), true)]
[CanEditMultipleObjects]
/// <summary>
/// Custom Editor for the HorizontalOrVerticalLayoutGroupEditor Component.
/// Extend this class to write a custom editor for a component derived from HorizontalOrVerticalLayoutGroupEditor.
/// </summary>
@wojteklu
wojteklu / clean_code.md
Last active May 12, 2024 06:31
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@kalinchernev
kalinchernev / countries
Created October 6, 2014 09:42
Plain text list of countries
Afghanistan
Albania
Algeria
Andorra
Angola
Antigua & Deps
Argentina
Armenia
Australia
Austria
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@MichaelPolla
MichaelPolla / github-resize-pictures.md
Last active May 12, 2024 06:24
Markdown - Resize pictures in GitHub, including in comments comment

Markdown - Resize pictures in GitHub

I found that the "best" way is to use HTML, as it works both in Readme/.md files and also in comments (within Issues, Gist...)

E.g. when adding/editing a comment (within Issues, Gist...) :

  • Upload the picture by drag-and-drop in the text field
  • replace ![image](https://your-image-url.type) with <img src="https://your-image-url.type" width="100" height="100">

As mentioned by @cbestow (thanks!), it's not mandatory to set both width and height. If only one is set, the other will be adjusted accordingly to preserve the aspect ratio of the image.

@katabame
katabame / build-hyprland-ubuntu.sh
Last active May 12, 2024 06:24
Build Hyprland on Ubuntu 23.10
#!/bin/bash
set -ex
# For Ubuntu 22.04
UBUNTU_VERSION=`lsb_release -r | awk '{print $2}'`
OLD_UBUNTU_VERSION='22.04'
PIXMAN_VERSION='0.43.4'
XCBPROTO_VERSION='1.17.0'
LIBXCB_VERSION='1.17.0'
@StarlitSkies
StarlitSkies / ctrcheck.gm9
Last active May 12, 2024 06:22
3DS firmware integrity checker
# A script for checking all of a 3DS system's important files and their integrity.
# original script by FrozenFire, overhaul & fixes by StarlitSkies
# last modified: NaN
@cleanup
set FULL "0"
set NAND "0"
set SDCARD "0"
set MISC "0"